FROM {{ namespace }}/{{ image_prefix }}swift-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}

{% block swift_proxy_server_header %}{% endblock %}

{% import "macros.j2" as macros with context %}

{% if install_type == 'binary' %}
    {% if base_package_type == 'rpm' %}
        {% set swift_proxy_server_packages = [
            'openstack-swift-proxy',
            'python3-ceilometermiddleware'
        ] %}
    {% elif base_package_type == 'deb' %}
        {% if base_distro == 'debian' %}
            {% set swift_proxy_server_packages = [
                'swift-proxy',
                'python3-ceilometermiddleware'
            ] %}
        {% else %}
            {% set swift_proxy_server_packages = [
                'swift-proxy',
                'python-ceilometermiddleware'
            ] %}
        {% endif %}
    {% endif %}

{{ macros.install_packages(swift_proxy_server_packages | customizable("packages")) }}

{% elif install_type == 'source' %}

{% set swift_proxy_server_pip_packages = [
    'ceilometermiddleware'
] %}

RUN {{ macros.install_pip(swift_proxy_server_pip_packages | customizable("pip_packages")) }}

{% endif %}

{% block swift_proxy_server_footer %}{% endblock %}
{% block footer %}{% endblock %}

USER swift
